import { createRouter, createWebHistory } from "vue-router"

//用来配置 路由页面的
const routes = [
    {
        path: '/home',
        name: 'home',
        component: () => import("@/views/Home.vue"),
        meta: { title: '首页', show: true, icon:'House' }
    },
    {
        path: '/',
        name: 'moveshow',
        component: () => import("@/views/MoveShow.vue"),
        meta: { title: '移动首页', show: false, icon: 'Position', useFrame: false}
    },
    {
        path: '/moveCategory',
        name: 'moveCategory',
        component: () => import("@/views/MoveCategory.vue"),
        meta: { title: '类目分类', show: false, icon: 'Position', useFrame: false }
    },
    {
        path: '/moveproductList',
        name: 'moveproductList',
        component: () => import("@/views/MoveProductList.vue"),
        meta: { title: '类目分类', show: false, icon: 'Position', useFrame: false }
    },
    {
        path: '/moveproductdetil',
        name: 'moveproductdetil',
        component: () => import("@/views/MoveProductDetil.vue"),
        meta: { title: '类目分类', show: false, icon: 'Position', useFrame: false }
    },

    {
        path: '/category',
        component: () => import("@/views/category/index.vue"),
        meta: { title: '类目管理', show: true, icon: 'Operation' },
        children: [
            {
                path: '/category/list',
                name: 'category-list',
                component: () => import("@/views/category/List.vue"),
                meta: { title: '类目列表', show: true, icon:'Memo'}
            },
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import("@/views/category/Add.vue"),
                meta: { title: '类目添加', show: true, icon: 'Plus' },
            },
            {
                path: '/category/edit',
                name: 'category-edit',
                component: () => import("@/views/category/Edit.vue"),
                meta: { title: '类目修改', show: false, icon: 'Edit' }
        
            }
        ]
    },
    {
        path: '/product',
        component: () => import("@/views/product/index.vue"),
        meta: { title: '商品管理', show: true, icon: 'GoodsFilled' },
        children: [
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import("@/views/product/List.vue"),
                meta: { title: '商品列表', show: true, icon: 'Memo' }
            },
            {
                path: '/product/add',
                name: 'product-add',
                component: () => import("@/views/product/Add.vue"),
                meta: { title: '商品添加', show: true, icon: 'Plus' },
            },
            {
                path: '/product/edit',
                name: 'product-edit',
                component: () => import("@/views/product/Edit.vue"),
               meta: { title: "商品修改", show: false, icon: 'Edit' }

            }
        ]
    },
]

//创建路由 实例化并且传递 routes 的配置
const router = createRouter({
    //路由的模式
    history: createWebHistory(),
    routes
})

//默认导出
export default router
